package com.ruoyi.eam.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.eam.mapper.EamSupplierMapper;
import com.ruoyi.eam.doman.EamSupplier;
import com.ruoyi.eam.service.IEamSupplierService;

/**
 * 资产供应商Service业务层处理
 *
 * @author xl
 * @date 2024-06-24
 */
@Service
public class EamSupplierServiceImpl implements IEamSupplierService
{
    @Autowired
    private EamSupplierMapper eamSupplierMapper;

    /**
     * 查询资产供应商
     *
     * @param supplierId 资产供应商主键
     * @return 资产供应商
     */
    @Override
    public EamSupplier selectEamSupplierBySupplierId(Integer supplierId)
    {
        return eamSupplierMapper.selectEamSupplierBySupplierId(supplierId);
    }

    /**
     * 查询资产供应商列表
     *
     * @param eamSupplier 资产供应商
     * @return 资产供应商
     */
    @Override
    public List<EamSupplier> selectEamSupplierList(EamSupplier eamSupplier)
    {
        return eamSupplierMapper.selectEamSupplierList(eamSupplier);
    }

    /**
     * 新增资产供应商
     *
     * @param eamSupplier 资产供应商
     * @return 结果
     */
    @Override
    public int insertEamSupplier(EamSupplier eamSupplier)
    {
        eamSupplier.setCreateTime(DateUtils.getNowDate());
        return eamSupplierMapper.insertEamSupplier(eamSupplier);
    }

    /**
     * 修改资产供应商
     *
     * @param eamSupplier 资产供应商
     * @return 结果
     */
    @Override
    public int updateEamSupplier(EamSupplier eamSupplier)
    {
        return eamSupplierMapper.updateEamSupplier(eamSupplier);
    }

    /**
     * 批量删除资产供应商
     *
     * @param supplierIds 需要删除的资产供应商主键
     * @return 结果
     */
    @Override
    public int deleteEamSupplierBySupplierIds(Integer[] supplierIds)
    {
        return eamSupplierMapper.deleteEamSupplierBySupplierIds(supplierIds);
    }

    /**
     * 删除资产供应商信息
     *
     * @param supplierId 资产供应商主键
     * @return 结果
     */
    @Override
    public int deleteEamSupplierBySupplierId(Integer supplierId)
    {
        return eamSupplierMapper.deleteEamSupplierBySupplierId(supplierId);
    }
}
